home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / lib / tex / inputs / named.bst < prev    next >
Encoding:
BibTeX style  |  1991-05-21  |  22.8 KB  |  1,297 lines

  1. % BibTeX `named' style file for BibTeX version 0.99c, LaTeX version 2.09
  2. % Place it in a file called named.bst in the BibTeX search path.  (Placing it
  3. % in the same directory as the LaTeX document should also work.)
  4. % Support for named citations is provided by named.sty
  5.  
  6. % This version was made by modifying the master file made by
  7. % Oren Patashnik (PATASHNIK@SCORE.STANFORD.EDU)
  8.  
  9. % Copyright (C) 1985, all rights reserved.
  10. % Modifications Copyright (C) 1988, 1989, Peter F. Patel-Schneider
  11. % Copying of this file is authorized only if either
  12. % (1) you make absolutely no changes to your copy, including name, or
  13. % (2) if you do make changes, you name it something other than
  14. % btxbst.doc, plain.bst, unsrt.bst, alpha.bst, and abbrv.bst.
  15. % This restriction helps ensure that all standard styles are identical.
  16.  
  17. % This style is NOT guaranteed to work.  It is provided in the hope
  18. % that it will make the preparation of papers easier.
  19. %
  20. % There are undoubtably bugs in this style.  If you make bug fixes,
  21. % improvements, etc.  please let me know.  My e-mail address is:
  22. %    pfps@research.att.com
  23.  
  24. % The preparation of this modified file was supported by Schlumberger Palo
  25. % Alto Research and AT\&T Bell Laboratories.
  26.  
  27. % This file can be used in other conferences as long as credit to the
  28. % authors and supporting agencies is retained, this notice is not changed,
  29. % and further modification or reuse is not restricted. 
  30.  
  31. %   Citation format: [author-last-name, year]
  32. %             [author-last-name and author-last-name, year]
  33. %             [author-last-name {\em et al.}, year]
  34. %
  35. %   Reference list ordering: alphabetical by author or whatever passes
  36. %    for author in the absence of one.
  37. %
  38. % This BibTeX style has support for short (year only) citations.  This
  39. % is done by having the citations actually look like
  40. %         \citeauthoryear{author-info}{year}
  41. % The LaTeX style has to have the following (or similar)
  42. %     \let\@internalcite\cite
  43. %     \def\cite{\def\citeauthoryear##1##2{##1, ##2}\@internalcite}
  44. %     \def\shortcite{\def\citeauthoryear##1{##2}\@internalcite}
  45. %     \def\@biblabel#1{\def\citeauthoryear##1##2{##1, ##2}[#1]\hfill}
  46. % which makes \shortcite the macro for short citations.
  47.  
  48. ENTRY
  49.   { address
  50.     author
  51.     booktitle
  52.     chapter
  53.     edition
  54.     editor
  55.     howpublished
  56.     institution
  57.     journal
  58.     key
  59.     month
  60.     note
  61.     number
  62.     organization
  63.     pages
  64.     publisher
  65.     school
  66.     series
  67.     title
  68.     type
  69.     volume
  70.     year
  71.   }
  72.   {}
  73.   { label extra.label sort.label }
  74.  
  75. INTEGERS { output.state before.all mid.sentence after.sentence after.block }
  76.  
  77. FUNCTION {init.state.consts}
  78. { #0 'before.all :=
  79.   #1 'mid.sentence :=
  80.   #2 'after.sentence :=
  81.   #3 'after.block :=
  82. }
  83.  
  84. STRINGS { s t }
  85.  
  86. FUNCTION {output.nonnull}
  87. { 's :=
  88.   output.state mid.sentence =
  89.     { ", " * write$ }
  90.     { output.state after.block =
  91.     { add.period$ write$
  92.       newline$
  93.       "\newblock " write$
  94.     }
  95.     { output.state before.all =
  96.         'write$
  97.         { add.period$ " " * write$ }
  98.       if$
  99.     }
  100.       if$
  101.       mid.sentence 'output.state :=
  102.     }
  103.   if$
  104.   s
  105. }
  106.  
  107. FUNCTION {output}
  108. { duplicate$ empty$
  109.     'pop$
  110.     'output.nonnull
  111.   if$
  112. }
  113.  
  114. FUNCTION {output.check}
  115. { 't :=
  116.   duplicate$ empty$
  117.     { pop$ "empty " t * " in " * cite$ * warning$ }
  118.     'output.nonnull
  119.   if$
  120. }
  121.  
  122. FUNCTION {output.bibitem}
  123. { newline$
  124.  
  125.   "\bibitem[" write$
  126.   label write$
  127.   "]{" write$
  128.  
  129.   cite$ write$
  130.   "}" write$
  131.   newline$
  132.   ""
  133.   before.all 'output.state :=
  134. }
  135.  
  136. FUNCTION {fin.entry}
  137. { add.period$
  138.   write$
  139.   newline$
  140. }
  141.  
  142. FUNCTION {new.block}
  143. { output.state before.all =
  144.     'skip$
  145.     { after.block 'output.state := }
  146.   if$
  147. }
  148.  
  149. FUNCTION {new.sentence}
  150. { output.state after.block =
  151.     'skip$
  152.     { output.state before.all =
  153.     'skip$
  154.     { after.sentence 'output.state := }
  155.       if$
  156.     }
  157.   if$
  158. }
  159.  
  160. FUNCTION {not}
  161. {   { #0 }
  162.     { #1 }
  163.   if$
  164. }
  165.  
  166. FUNCTION {and}
  167. {   'skip$
  168.     { pop$ #0 }
  169.   if$
  170. }
  171.  
  172. FUNCTION {or}
  173. {   { pop$ #1 }
  174.     'skip$
  175.   if$
  176. }
  177.  
  178. FUNCTION {new.block.checka}
  179. { empty$
  180.     'skip$
  181.     'new.block
  182.   if$
  183. }
  184.  
  185. FUNCTION {new.block.checkb}
  186. { empty$
  187.   swap$ empty$
  188.   and
  189.     'skip$
  190.     'new.block
  191.   if$
  192. }
  193.  
  194. FUNCTION {new.sentence.checka}
  195. { empty$
  196.     'skip$
  197.     'new.sentence
  198.   if$
  199. }
  200.  
  201. FUNCTION {new.sentence.checkb}
  202. { empty$
  203.   swap$ empty$
  204.   and
  205.     'skip$
  206.     'new.sentence
  207.   if$
  208. }
  209.  
  210. FUNCTION {field.or.null}
  211. { duplicate$ empty$
  212.     { pop$ "" }
  213.     'skip$
  214.   if$
  215. }
  216.  
  217. FUNCTION {emphasize}
  218. { duplicate$ empty$
  219.     { pop$ "" }
  220.     { "{\em " swap$ * "}" * }
  221.   if$
  222. }
  223.  
  224. INTEGERS { nameptr namesleft numnames }
  225.  
  226. FUNCTION {format.names}
  227. { 's :=
  228.   #1 'nameptr :=
  229.   s num.names$ 'numnames :=
  230.   numnames 'namesleft :=
  231.     { namesleft #0 > }
  232.  
  233.     { s nameptr "{ff~}{vv~}{ll}{, jj}" format.name$ 't :=
  234.  
  235.       nameptr #1 >
  236.     { namesleft #1 >
  237.         { ", " * t * }
  238.         { numnames #2 >
  239.         { "," * }
  240.         'skip$
  241.           if$
  242.           t "others" =
  243.         { " et~al." * }
  244.         { " and " * t * }
  245.           if$
  246.         }
  247.       if$
  248.     }
  249.     't
  250.       if$
  251.       nameptr #1 + 'nameptr :=
  252.       namesleft #1 - 'namesleft :=
  253.     }
  254.   while$
  255. }
  256.  
  257. FUNCTION {format.authors}
  258. { author empty$
  259.     { "" }
  260.     { author format.names }
  261.   if$
  262. }
  263.  
  264. FUNCTION {format.editors}
  265. { editor empty$
  266.     { "" }
  267.     { editor format.names
  268.       editor num.names$ #1 >
  269.     { ", editors" * }
  270.     { ", editor" * }
  271.       if$
  272.     }
  273.   if$
  274. }
  275.  
  276. FUNCTION {format.title}
  277. { title empty$
  278.     { "" }
  279.  
  280.     { title "t" change.case$ }
  281.  
  282.   if$
  283. }
  284.  
  285. FUNCTION {n.dashify}
  286. { 't :=
  287.   ""
  288.     { t empty$ not }
  289.     { t #1 #1 substring$ "-" =
  290.     { t #1 #2 substring$ "--" = not
  291.         { "--" *
  292.           t #2 global.max$ substring$ 't :=
  293.         }
  294.         {   { t #1 #1 substring$ "-" = }
  295.         { "-" *
  296.           t #2 global.max$ substring$ 't :=
  297.         }
  298.           while$
  299.         }
  300.       if$
  301.     }
  302.     { t #1 #1 substring$ *
  303.       t #2 global.max$ substring$ 't :=
  304.     }
  305.       if$
  306.     }
  307.   while$
  308. }
  309.  
  310. FUNCTION {format.date}
  311. { year empty$
  312.     { month empty$
  313.     { "" }
  314.     { "there's a month but no year in " cite$ * warning$
  315.       month
  316.     }
  317.       if$
  318.     }
  319.     { month empty$
  320.     'year
  321.     { month " " * year * }
  322.       if$
  323.     }
  324.   if$
  325. }
  326.  
  327. FUNCTION {format.btitle}
  328. { title emphasize
  329. }
  330.  
  331. FUNCTION {tie.or.space.connect}
  332. { duplicate$ text.length$ #3 <
  333.     { "~" }
  334.     { " " }
  335.   if$
  336.   swap$ * *
  337. }
  338.  
  339. FUNCTION {either.or.check}
  340. { empty$
  341.     'pop$
  342.     { "can't use both " swap$ * " fields in " * cite$ * warning$ }
  343.   if$
  344. }
  345.  
  346. FUNCTION {format.bvolume}
  347. { volume empty$
  348.     { "" }
  349.     { "volume" volume tie.or.space.connect
  350.       series empty$
  351.     'skip$
  352.     { " of " * series emphasize * }
  353.       if$
  354.       "volume and number" number either.or.check
  355.     }
  356.   if$
  357. }
  358.  
  359. FUNCTION {format.number.series}
  360. { volume empty$
  361.     { number empty$
  362.     { series field.or.null }
  363.     { output.state mid.sentence =
  364.         { "number" }
  365.         { "Number" }
  366.       if$
  367.       number tie.or.space.connect
  368.       series empty$
  369.         { "there's a number but no series in " cite$ * warning$ }
  370.         { " in " * series * }
  371.       if$
  372.     }
  373.       if$
  374.     }
  375.     { "" }
  376.   if$
  377. }
  378.  
  379. FUNCTION {format.edition}
  380. { edition empty$
  381.     { "" }
  382.     { output.state mid.sentence =
  383.     { edition "l" change.case$ " edition" * }
  384.     { edition "t" change.case$ " edition" * }
  385.       if$
  386.     }
  387.   if$
  388. }
  389.  
  390. INTEGERS { multiresult }
  391.  
  392. FUNCTION {multi.page.check}
  393. { 't :=
  394.   #0 'multiresult :=
  395.     { multiresult not
  396.       t empty$ not
  397.       and
  398.     }
  399.     { t #1 #1 substring$
  400.       duplicate$ "-" =
  401.       swap$ duplicate$ "," =
  402.       swap$ "+" =
  403.       or or
  404.     { #1 'multiresult := }
  405.     { t #2 global.max$ substring$ 't := }
  406.       if$
  407.     }
  408.   while$
  409.   multiresult
  410. }
  411.  
  412. FUNCTION {format.pages}
  413. { pages empty$
  414.     { "" }
  415.     { pages multi.page.check
  416.     { "pages" pages n.dashify tie.or.space.connect }
  417.     { "page" pages tie.or.space.connect }
  418.       if$
  419.     }
  420.   if$
  421. }
  422.  
  423. FUNCTION {format.vol.num.pages}
  424. { volume field.or.null
  425.   number empty$
  426.     'skip$
  427.     { "(" number * ")" * *
  428.       volume empty$
  429.     { "there's a number but no volume in " cite$ * warning$ }
  430.     'skip$
  431.       if$
  432.     }
  433.   if$
  434.   pages empty$
  435.     'skip$
  436.     { duplicate$ empty$
  437.     { pop$ format.pages }
  438.     { ":" * pages n.dashify * }
  439.       if$
  440.     }
  441.   if$
  442. }
  443.  
  444. FUNCTION {format.chapter.pages}
  445. { chapter empty$
  446.     'format.pages
  447.     { type empty$
  448.     { "chapter" }
  449.     { type "l" change.case$ }
  450.       if$
  451.       chapter tie.or.space.connect
  452.       pages empty$
  453.     'skip$
  454.     { ", " * format.pages * }
  455.       if$
  456.     }
  457.   if$
  458. }
  459.  
  460. FUNCTION {format.in.ed.booktitle}
  461. { booktitle empty$
  462.     { "" }
  463.     { editor empty$
  464.     { "In " booktitle emphasize * }
  465.     { "In " format.editors * ", " * booktitle emphasize * }
  466.       if$
  467.     }
  468.   if$
  469. }
  470.  
  471. FUNCTION {empty.misc.check}
  472. { author empty$ title empty$ howpublished empty$
  473.   month empty$ year empty$ note empty$
  474.   and and and and and
  475.  
  476.   key empty$ not and
  477.  
  478.     { "all relevant fields are empty in " cite$ * warning$ }
  479.     'skip$
  480.   if$
  481. }
  482.  
  483. FUNCTION {format.thesis.type}
  484. { type empty$
  485.     'skip$
  486.     { pop$
  487.       type "t" change.case$
  488.     }
  489.   if$
  490. }
  491.  
  492. FUNCTION {format.tr.number}
  493. { type empty$
  494.     { "Technical Report" }
  495.     'type
  496.   if$
  497.   number empty$
  498.     { "t" change.case$ }
  499.     { number tie.or.space.connect }
  500.   if$
  501. }
  502.  
  503. FUNCTION {format.article.crossref}
  504. { key empty$
  505.     { journal empty$
  506.     { "need key or journal for " cite$ * " to crossref " * crossref *
  507.       warning$
  508.       ""
  509.     }
  510.     { "In {\em " journal * "\/}" * }
  511.       if$
  512.     }
  513.     { "In " key * }
  514.   if$
  515.   " \shortcite{" * crossref * "}" *
  516. }
  517.  
  518. FUNCTION {format.crossref.editor}
  519. { editor #1 "{vv~}{ll}" format.name$
  520.   editor num.names$ duplicate$
  521.   #2 >
  522.     { pop$ " et~al." * }
  523.     { #2 <
  524.     'skip$
  525.     { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" =
  526.         { " et~al." * }
  527.         { " and " * editor #2 "{vv~}{ll}" format.name$ * }
  528.       if$
  529.     }
  530.       if$
  531.     }
  532.   if$
  533. }
  534.  
  535. FUNCTION {format.book.crossref}
  536. { volume empty$
  537.     { "empty volume in " cite$ * "'s crossref of " * crossref * warning$
  538.       "In "
  539.     }
  540.     { "Volume" volume tie.or.space.connect
  541.       " of " *
  542.     }
  543.   if$
  544.   editor empty$
  545.   editor field.or.null author field.or.null =
  546.   or
  547.     { key empty$
  548.     { series empty$
  549.         { "need editor, key, or series for " cite$ * " to crossref " *
  550.           crossref * warning$
  551.           "" *
  552.         }
  553.         { "{\em " * series * "\/}" * }
  554.       if$
  555.     }
  556.     { key * }
  557.       if$
  558.     }
  559.     { format.crossref.editor * }
  560.   if$
  561.   " \shortcite{" * crossref * "}" *
  562. }
  563.  
  564. FUNCTION {format.incoll.inproc.crossref}
  565. { editor empty$
  566.   editor field.or.null author field.or.null =
  567.   or
  568.     { key empty$
  569.     { booktitle empty$
  570.         { "need editor, key, or booktitle for " cite$ * " to crossref " *
  571.           crossref * warning$
  572.           ""
  573.         }
  574.         { "In {\em " booktitle * "\/}" * }
  575.       if$
  576.     }
  577.     { "In " key * }
  578.       if$
  579.     }
  580.     { "In " format.crossref.editor * }
  581.   if$
  582.   " \shortcite{" * crossref * "}" *
  583. }
  584.  
  585. FUNCTION {article}
  586. { output.bibitem
  587.   format.authors "author" output.check
  588.   new.block
  589.   format.title "title" output.check
  590.   new.block
  591.   crossref missing$
  592.     { journal emphasize "journal" output.check
  593.       format.vol.num.pages output
  594.       format.date "year" output.check
  595.     }
  596.     { format.article.crossref output.nonnull
  597.       format.pages output
  598.     }
  599.   if$
  600.   new.block
  601.   note output
  602.   fin.entry
  603. }
  604.  
  605. FUNCTION {book}
  606. { output.bibitem
  607.   author empty$
  608.     { format.editors "author and editor" output.check }
  609.     { format.authors output.nonnull
  610.       crossref missing$
  611.     { "author and editor" editor either.or.check }
  612.     'skip$
  613.       if$
  614.     }
  615.   if$
  616.   new.block
  617.   format.btitle "title" output.check
  618.   crossref missing$
  619.     { format.bvolume output
  620.       new.block
  621.       format.number.series output
  622.       new.sentence
  623.       publisher "publisher" output.check
  624.       address output
  625.     }
  626.     { new.block
  627.       format.book.crossref output.nonnull
  628.     }
  629.   if$
  630.   format.edition output
  631.   format.date "year" output.check
  632.   new.block
  633.   note output
  634.   fin.entry
  635. }
  636.  
  637. FUNCTION {booklet}
  638. { output.bibitem
  639.   format.authors output
  640.   new.block
  641.   format.title "title" output.check
  642.   howpublished address new.block.checkb
  643.   howpublished output
  644.   address output
  645.   format.date output
  646.   new.block
  647.   note output
  648.   fin.entry
  649. }
  650.  
  651. FUNCTION {inbook}
  652. { output.bibitem
  653.   author empty$
  654.     { format.editors "author and editor" output.check }
  655.     { format.authors output.nonnull
  656.       crossref missing$
  657.     { "author and editor" editor either.or.check }
  658.     'skip$
  659.       if$
  660.     }
  661.   if$
  662.   new.block
  663.   format.btitle "title" output.check
  664.   crossref missing$
  665.     { format.bvolume output
  666.       format.chapter.pages "chapter and pages" output.check
  667.       new.block
  668.       format.number.series output
  669.       new.sentence
  670.       publisher "publisher" output.check
  671.       address output
  672.     }
  673.     { format.chapter.pages "chapter and pages" output.check
  674.       new.block
  675.       format.book.crossref output.nonnull
  676.     }
  677.   if$
  678.   format.edition output
  679.   format.date "year" output.check
  680.   new.block
  681.   note output
  682.   fin.entry
  683. }
  684.  
  685. FUNCTION {incollection}
  686. { output.bibitem
  687.   format.authors "author" output.check
  688.   new.block
  689.   format.title "title" output.check
  690.   new.block
  691.   crossref missing$
  692.     { format.in.ed.booktitle "booktitle" output.check
  693.       format.bvolume output
  694.       format.number.series output
  695.       format.chapter.pages output
  696.       new.sentence
  697.       publisher "publisher" output.check
  698.       address output
  699.       format.edition output
  700.       format.date "year" output.check
  701.     }
  702.     { format.incoll.inproc.crossref output.nonnull
  703.       format.chapter.pages output
  704.     }
  705.   if$
  706.   new.block
  707.   note output
  708.   fin.entry
  709. }
  710.  
  711. FUNCTION {inproceedings}
  712. { output.bibitem
  713.   format.authors "author" output.check
  714.   new.block
  715.   format.title "title" output.check
  716.   new.block
  717.   crossref missing$
  718.     { format.in.ed.booktitle "booktitle" output.check
  719.       format.bvolume output
  720.       format.number.series output
  721.       format.pages output
  722.       address empty$
  723.     { organization publisher new.sentence.checkb
  724.       organization output
  725.       publisher output
  726.       format.date "year" output.check
  727.     }
  728.     { address output.nonnull
  729.       format.date "year" output.check
  730.       new.sentence
  731.       organization output
  732.       publisher output
  733.     }
  734.       if$
  735.     }
  736.     { format.incoll.inproc.crossref output.nonnull
  737.       format.pages output
  738.     }
  739.   if$
  740.   new.block
  741.   note output
  742.   fin.entry
  743. }
  744.  
  745. FUNCTION {conference} { inproceedings }
  746.  
  747. FUNCTION {manual}
  748. { output.bibitem
  749.   author empty$
  750.     { organization empty$
  751.     'skip$
  752.     { organization output.nonnull
  753.       address output
  754.     }
  755.       if$
  756.     }
  757.     { format.authors output.nonnull }
  758.   if$
  759.   new.block
  760.   format.btitle "title" output.check
  761.   author empty$
  762.     { organization empty$
  763.     { address new.block.checka
  764.       address output
  765.     }
  766.     'skip$
  767.       if$
  768.     }
  769.     { organization address new.block.checkb
  770.       organization output
  771.       address output
  772.     }
  773.   if$
  774.   format.edition output
  775.   format.date output
  776.   new.block
  777.   note output
  778.   fin.entry
  779. }
  780.  
  781. FUNCTION {mastersthesis}
  782. { output.bibitem
  783.   format.authors "author" output.check
  784.   new.block
  785.   format.title "title" output.check
  786.   new.block
  787.   "Master's thesis" format.thesis.type output.nonnull
  788.   school "school" output.check
  789.   address output
  790.   format.date "year" output.check
  791.   new.block
  792.   note output
  793.   fin.entry
  794. }
  795.  
  796. FUNCTION {misc}
  797. { output.bibitem
  798.   format.authors output
  799.   title howpublished new.block.checkb
  800.   format.title output
  801.   howpublished new.block.checka
  802.   howpublished output
  803.   format.date output
  804.   new.block
  805.   note output
  806.   fin.entry
  807.   empty.misc.check
  808. }
  809.  
  810. FUNCTION {phdthesis}
  811. { output.bibitem
  812.   format.authors "author" output.check
  813.   new.block
  814.   format.btitle "title" output.check
  815.   new.block
  816.   "PhD thesis" format.thesis.type output.nonnull
  817.   school "school" output.check
  818.   address output
  819.   format.date "year" output.check
  820.   new.block
  821.   note output
  822.   fin.entry
  823. }
  824.  
  825. FUNCTION {proceedings}
  826. { output.bibitem
  827.   editor empty$
  828.     { organization output }
  829.     { format.editors output.nonnull }
  830.   if$
  831.   new.block
  832.   format.btitle "title" output.check
  833.   format.bvolume output
  834.   format.number.series output
  835.   address empty$
  836.     { editor empty$
  837.     { publisher new.sentence.checka }
  838.     { organization publisher new.sentence.checkb
  839.       organization output
  840.     }
  841.       if$
  842.       publisher output
  843.       format.date "year" output.check
  844.     }
  845.     { address output.nonnull
  846.       format.date "year" output.check
  847.       new.sentence
  848.       editor empty$
  849.     'skip$
  850.     { organization output }
  851.       if$
  852.       publisher output
  853.     }
  854.   if$
  855.   new.block
  856.   note output
  857.   fin.entry
  858. }
  859.  
  860. FUNCTION {techreport}
  861. { output.bibitem
  862.   format.authors "author" output.check
  863.   new.block
  864.   format.title "title" output.check
  865.   new.block
  866.   format.tr.number output.nonnull
  867.   institution "institution" output.check
  868.   address output
  869.   format.date "year" output.check
  870.   new.block
  871.   note output
  872.   fin.entry
  873. }
  874.  
  875. FUNCTION {unpublished}
  876. { output.bibitem
  877.   format.authors "author" output.check
  878.   new.block
  879.   format.title "title" output.check
  880.   new.block
  881.   note "note" output.check
  882.   format.date output
  883.   fin.entry
  884. }
  885.  
  886. FUNCTION {default.type} { misc }
  887.  
  888. MACRO {jan} {"January"}
  889.  
  890. MACRO {feb} {"February"}
  891.  
  892. MACRO {mar} {"March"}
  893.  
  894. MACRO {apr} {"April"}
  895.  
  896. MACRO {may} {"May"}
  897.  
  898. MACRO {jun} {"June"}
  899.  
  900. MACRO {jul} {"July"}
  901.  
  902. MACRO {aug} {"August"}
  903.  
  904. MACRO {sep} {"September"}
  905.  
  906. MACRO {oct} {"October"}
  907.  
  908. MACRO {nov} {"November"}
  909.  
  910. MACRO {dec} {"December"}
  911.  
  912. MACRO {acmcs} {"ACM Computing Surveys"}
  913.  
  914. MACRO {acta} {"Acta Informatica"}
  915.  
  916. MACRO {cacm} {"Communications of the ACM"}
  917.  
  918. MACRO {ibmjrd} {"IBM Journal of Research and Development"}
  919.  
  920. MACRO {ibmsj} {"IBM Systems Journal"}
  921.  
  922. MACRO {ieeese} {"IEEE Transactions on Software Engineering"}
  923.  
  924. MACRO {ieeetc} {"IEEE Transactions on Computers"}
  925.  
  926. MACRO {ieeetcad}
  927.  {"IEEE Transactions on Computer-Aided Design of Integrated Circuits"}
  928.  
  929. MACRO {ipl} {"Information Processing Letters"}
  930.  
  931. MACRO {jacm} {"Journal of the ACM"}
  932.  
  933. MACRO {jcss} {"Journal of Computer and System Sciences"}
  934.  
  935. MACRO {scp} {"Science of Computer Programming"}
  936.  
  937. MACRO {sicomp} {"SIAM Journal on Computing"}
  938.  
  939. MACRO {tocs} {"ACM Transactions on Computer Systems"}
  940.  
  941. MACRO {tods} {"ACM Transactions on Database Systems"}
  942.  
  943. MACRO {tog} {"ACM Transactions on Graphics"}
  944.  
  945. MACRO {toms} {"ACM Transactions on Mathematical Software"}
  946.  
  947. MACRO {toois} {"ACM Transactions on Office Information Systems"}
  948.  
  949. MACRO {toplas} {"ACM Transactions on Programming Languages and Systems"}
  950.  
  951. MACRO {tcs} {"Theoretical Computer Science"}
  952.  
  953. READ
  954.  
  955. FUNCTION {sortify}
  956. { purify$
  957.   "l" change.case$
  958. }
  959.  
  960. INTEGERS { len }
  961.  
  962. FUNCTION {chop.word}
  963. { 's :=
  964.   'len :=
  965.   s #1 len substring$ =
  966.     { s len #1 + global.max$ substring$ }
  967.     's
  968.   if$
  969. }
  970.  
  971. INTEGERS { et.al.char.used }
  972.  
  973. FUNCTION {initialize.et.al.char.used}
  974. { #0 'et.al.char.used :=
  975. }
  976.  
  977. EXECUTE {initialize.et.al.char.used}
  978.  
  979. FUNCTION {format.lab.names}
  980. { 's :=
  981.   s num.names$ 'numnames :=
  982.  
  983.   numnames #1 =
  984.     { s #1 "{vv }{ll}" format.name$ }
  985.     { numnames #2 =
  986.         { s #1 "{vv }{ll }and " format.name$ s #2 "{vv }{ll}" format.name$ *
  987.         }
  988.         { s #1 "{vv }{ll }\bgroup \em et al.\egroup " format.name$ }
  989.       if$
  990.     }
  991.   if$
  992.  
  993. }
  994.  
  995. FUNCTION {author.key.label}
  996. { author empty$
  997.     { key empty$
  998.  
  999.     { cite$ #1 #3 substring$ }
  1000.  
  1001.     { key }
  1002.       if$
  1003.     }
  1004.     { author format.lab.names }
  1005.   if$
  1006. }
  1007.  
  1008. FUNCTION {author.editor.key.label}
  1009. { author empty$
  1010.     { editor empty$
  1011.     { key empty$
  1012.  
  1013.         { cite$ #1 #3 substring$ }
  1014.  
  1015.         { key }
  1016.       if$
  1017.     }
  1018.     { editor format.lab.names }
  1019.       if$
  1020.     }
  1021.     { author format.lab.names }
  1022.   if$
  1023. }
  1024.  
  1025. FUNCTION {author.key.organization.label}
  1026. { author empty$
  1027.     { key empty$
  1028.     { organization empty$
  1029.  
  1030.         { cite$ #1 #3 substring$ }
  1031.  
  1032.         { "The " #4 organization chop.word #3 text.prefix$ }
  1033.       if$
  1034.     }
  1035.     { key }
  1036.       if$
  1037.     }
  1038.     { author format.lab.names }
  1039.   if$
  1040. }
  1041.  
  1042. FUNCTION {editor.key.organization.label}
  1043. { editor empty$
  1044.     { key empty$
  1045.     { organization empty$
  1046.  
  1047.         { cite$ #1 #3 substring$ }
  1048.  
  1049.         { "The " #4 organization chop.word #3 text.prefix$ }
  1050.       if$
  1051.     }
  1052.     { key }
  1053.       if$
  1054.     }
  1055.     { editor format.lab.names }
  1056.   if$
  1057. }
  1058.  
  1059. FUNCTION {calc.label}
  1060. { type$ "book" =
  1061.   type$ "inbook" =
  1062.   or
  1063.     'author.editor.key.label
  1064.     { type$ "proceedings" =
  1065.     'editor.key.organization.label
  1066.     { type$ "manual" =
  1067.         'author.key.organization.label
  1068.         'author.key.label
  1069.       if$
  1070.     }
  1071.       if$
  1072.     }
  1073.   if$
  1074.   duplicate$
  1075.  
  1076.   "\protect\citeauthoryear{" swap$ * "}{" *
  1077.   year field.or.null purify$ *  % CHANGED - pfps - 15 Feb 1989
  1078.   'label :=
  1079.   year field.or.null purify$ *
  1080.  
  1081.   sortify 'sort.label :=
  1082. }
  1083.  
  1084. FUNCTION {sort.format.names}
  1085. { 's :=
  1086.   #1 'nameptr :=
  1087.   ""
  1088.   s num.names$ 'numnames :=
  1089.   numnames 'namesleft :=
  1090.     { namesleft #0 > }
  1091.     { nameptr #1 >
  1092.     { "   " * }
  1093.     'skip$
  1094.       if$
  1095.  
  1096.       s nameptr "{vv{ } }{ll{ }}{  ff{ }}{  jj{ }}" format.name$ 't :=
  1097.  
  1098.       nameptr numnames = t "others" = and
  1099.     { "et al" * }
  1100.     { t sortify * }
  1101.       if$
  1102.       nameptr #1 + 'nameptr :=
  1103.       namesleft #1 - 'namesleft :=
  1104.     }
  1105.   while$
  1106. }
  1107.  
  1108. FUNCTION {sort.format.title}
  1109. { 't :=
  1110.   "A " #2
  1111.     "An " #3
  1112.       "The " #4 t chop.word
  1113.     chop.word
  1114.   chop.word
  1115.   sortify
  1116.   #1 global.max$ substring$
  1117. }
  1118.  
  1119. FUNCTION {author.sort}
  1120. { author empty$
  1121.     { key empty$
  1122.     { "to sort, need author or key in " cite$ * warning$
  1123.       ""
  1124.     }
  1125.     { key sortify }
  1126.       if$
  1127.     }
  1128.     { author sort.format.names }
  1129.   if$
  1130. }
  1131.  
  1132. FUNCTION {author.editor.sort}
  1133. { author empty$
  1134.     { editor empty$
  1135.     { key empty$
  1136.         { "to sort, need author, editor, or key in " cite$ * warning$
  1137.           ""
  1138.         }
  1139.         { key sortify }
  1140.       if$
  1141.     }
  1142.     { editor sort.format.names }
  1143.       if$
  1144.     }
  1145.     { author sort.format.names }
  1146.   if$
  1147. }
  1148.  
  1149. FUNCTION {author.organization.sort}
  1150. { author empty$
  1151.     { organization empty$
  1152.     { key empty$
  1153.         { "to sort, need author, organization, or key in " cite$ * warning$
  1154.           ""
  1155.         }
  1156.         { key sortify }
  1157.       if$
  1158.     }
  1159.     { "The " #4 organization chop.word sortify }
  1160.       if$
  1161.     }
  1162.     { author sort.format.names }
  1163.   if$
  1164. }
  1165.  
  1166. FUNCTION {editor.organization.sort}
  1167. { editor empty$
  1168.     { organization empty$
  1169.     { key empty$
  1170.         { "to sort, need editor, organization, or key in " cite$ * warning$
  1171.           ""
  1172.         }
  1173.         { key sortify }
  1174.       if$
  1175.     }
  1176.     { "The " #4 organization chop.word sortify }
  1177.       if$
  1178.     }
  1179.     { editor sort.format.names }
  1180.   if$
  1181. }
  1182.  
  1183. FUNCTION {presort}
  1184.  
  1185. { calc.label
  1186.   sort.label
  1187.   "    "
  1188.   *
  1189.   type$ "book" =
  1190.  
  1191.   type$ "inbook" =
  1192.   or
  1193.     'author.editor.sort
  1194.     { type$ "proceedings" =
  1195.     'editor.organization.sort
  1196.     { type$ "manual" =
  1197.         'author.organization.sort
  1198.         'author.sort
  1199.       if$
  1200.     }
  1201.       if$
  1202.     }
  1203.   if$
  1204.  
  1205.   *
  1206.  
  1207.   "    "
  1208.   *
  1209.   year field.or.null sortify
  1210.   *
  1211.   "    "
  1212.   *
  1213.   title field.or.null
  1214.   sort.format.title
  1215.   *
  1216.   #1 entry.max$ substring$
  1217.   'sort.key$ :=
  1218. }
  1219.  
  1220. ITERATE {presort}
  1221.  
  1222. SORT
  1223.  
  1224. STRINGS { longest.label last.sort.label next.extra }
  1225.  
  1226. INTEGERS { longest.label.width last.extra.num }
  1227.  
  1228. FUNCTION {initialize.longest.label}
  1229. { "" 'longest.label :=
  1230.   #0 int.to.chr$ 'last.sort.label :=
  1231.   "" 'next.extra :=
  1232.   #0 'longest.label.width :=
  1233.   #0 'last.extra.num :=
  1234. }
  1235.  
  1236. FUNCTION {forward.pass}
  1237. { last.sort.label sort.label =
  1238.     { last.extra.num #1 + 'last.extra.num :=
  1239.       last.extra.num int.to.chr$ 'extra.label :=
  1240.     }
  1241.     { "a" chr.to.int$ 'last.extra.num :=
  1242.       "" 'extra.label :=
  1243.       sort.label 'last.sort.label :=
  1244.     }
  1245.   if$
  1246. }
  1247.  
  1248. FUNCTION {reverse.pass}
  1249. { next.extra "b" =
  1250.     { "a" 'extra.label := }
  1251.     'skip$
  1252.   if$
  1253.   label extra.label * "}" * 'label :=   % CHANGED - pfps 15 Feb 1989
  1254.   label width$ longest.label.width >
  1255.     { label 'longest.label :=
  1256.       label width$ 'longest.label.width :=
  1257.     }
  1258.     'skip$
  1259.   if$
  1260.   extra.label 'next.extra :=
  1261. }
  1262.  
  1263. EXECUTE {initialize.longest.label}
  1264.  
  1265. ITERATE {forward.pass}
  1266.  
  1267. REVERSE {reverse.pass}
  1268.  
  1269. FUNCTION {begin.bib}
  1270.  
  1271. { et.al.char.used
  1272.     { "\newcommand{\etalchar}[1]{$^{#1}$}" write$ newline$ }
  1273.     'skip$
  1274.   if$
  1275.   preamble$ empty$
  1276.  
  1277.     'skip$
  1278.     { preamble$ write$ newline$ }
  1279.   if$
  1280.  
  1281.   "\begin{thebibliography}{}" write$ newline$
  1282.  
  1283. }
  1284.  
  1285. EXECUTE {begin.bib}
  1286.  
  1287. EXECUTE {init.state.consts}
  1288.  
  1289. ITERATE {call.type$}
  1290.  
  1291. FUNCTION {end.bib}
  1292. { newline$
  1293.   "\end{thebibliography}" write$ newline$
  1294. }
  1295.  
  1296. EXECUTE {end.bib}
  1297.